package org.example.bean.enums;

import lombok.Getter;

@Getter
public enum FunctionType {

    HOMEPAGE(0, "首页"),
    DRILL(1, "下钻"),
    KPI(2, "绩效"),
    ;

    private final Integer code;
    private final String description;

    FunctionType(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static FunctionType ofCode(Integer code) {
        for (FunctionType type : FunctionType.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
